{% extends "base.html" %}

{% block content %}

<table border="1" width="100%">
  <tr align="center">
    <th>front of card</th>
    <th>back of card</th>
    <th>score</th>
    <th>&nbsp;</th>
  </tr>
  {% for card in cards %}
  <tr align="center">
    <form action="/delete" method="post">
      <td>{{ card.front|escape }}</td>
      <td>{{ card.back|escape }}</td>
      <td>{{ card.score }}</td>
      <td>
        <input type="hidden" name="edit_url" value="{{ card.edit_url}}">
        <input type="submit" value="delete">
      </td>
    </form>
  </tr>
  {% endfor %}
  <form action="/insert" method="post">
    <tr align="center">
      <td>Question: <input type="text" name="front"></td>
      <td>Answer: <input type="text" name="back"></td>
      <td>&nbsp;</td>
      <td><input type="submit" value="add"></td>
    </tr>
  </form>
</table>
</form>
<div align='right'>
  <a href='{{ spreadsheet_url }}'>Goto Spreadsheet</a>
</div>

{% endblock %}
